﻿namespace Microsoft.SharePoint.Client
{
    using System;
    using System.ComponentModel;

    [ScriptType("SP.ChangeAlert", ServerTypeId="{04f51ef5-013c-4e05-b23f-a9719e69a49a}")]
    public class ChangeAlert : Change
    {
        [EditorBrowsable(EditorBrowsableState.Never)]
        public ChangeAlert(ClientRuntimeContext Context, ObjectPath ObjectPath) : base(Context, ObjectPath)
        {
        }

        protected override bool InitOnePropertyFromJson(string peekedName, JsonReader reader)
        {
            bool flag = base.InitOnePropertyFromJson(peekedName, reader);
            if (!flag)
            {
                string str = peekedName;
                if (str == null)
                {
                    return flag;
                }
                if (!(str == "WebId"))
                {
                    if (str == "AlertId")
                    {
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["AlertId"] = reader.ReadGuid();
                    }
                    return flag;
                }
                flag = true;
                reader.ReadName();
                base.ObjectData.Properties["WebId"] = reader.ReadGuid();
            }
            return flag;
        }

        [Remote]
        public Guid AlertId
        {
            get
            {
                base.CheckUninitializedProperty("AlertId");
                return (Guid) base.ObjectData.Properties["AlertId"];
            }
        }

        [Remote]
        public Guid WebId
        {
            get
            {
                base.CheckUninitializedProperty("WebId");
                return (Guid) base.ObjectData.Properties["WebId"];
            }
        }
    }
}

